package com.yuandian.api.management.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;

/**
 * 告警信息-实体
 * @author zfsn
 * @date 2023-4-4
 */
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "告警信息", description = "告警信息主表")
@TableName("conf_alarm")
public class ConfAlarm extends BasePage<ConfAlarm> {

	/**
	 *
	 */
	@ApiModelProperty(value = "告警编号", notes = "")
	@TableId(type = IdType.AUTO)
	private Integer id;

	/**
	 *
	 */
	@ApiModelProperty(value = "告警名称", notes = "")
	private String name;

	/**
	 * 1为基础告警，2为统计告警
	 */
	@JsonIgnore
	@ApiModelProperty(value = "指标类型", notes = "1为基础告警，2为基础告警")
	private Integer type;

	/**
	 *
	 */
	@ApiModelProperty(value = "告警指标", notes = "")
	private Integer alarmIndicatorId;

	/**
	 *
	 */
	@TableField(exist = false)
	@ApiModelProperty(value = "告警指标(多选)", notes = "")
	private List<Integer> alarmIndicatorIds;


	/**
	 *
	 */
	@TableField(exist = false)
	@ApiModelProperty(value = "告警信息模板(多选)", notes = "")
	private List<Integer> alarmTemplateIds;

	/**
	 *
	 */
	@ApiModelProperty(value = "告警对象", notes = "")
	private Integer alarmObjId;

	/**
	 *
	 */
	@ApiModelProperty(value = "告警信息模板", notes = "")
	private Integer alarmTemplateId;

	/**
	 *
	 */
	@ApiModelProperty(value = "起步值", notes = "")
	private Integer startValue;

	/**
	 * 0-启用 1-禁用
	 */
	@ApiModelProperty(value = "启用状态", notes = "0-启用 1-禁用")
	private Integer isEnable;

	/**
	 *
	 */
	@ApiModelProperty(value = "创建人", notes = "")
	private String createBy;

	/**
	 *
	 */
	@ApiModelProperty(value = "创建时间", notes = "")
	private LocalDateTime createTime;

	/**
	 *
	 */
	@ApiModelProperty(value = "更新人", notes = "")
	private String updateBy;

	/**
	 *
	 */
	@ApiModelProperty(value = "更新时间", notes = "")
	private LocalDateTime updateTime;

	/**
	 * 是否逻辑删除，0：否、1：是
	 */
	@ApiModelProperty(value = "是否逻辑删除", notes = "是否逻辑删除，0：否、1：是")
	private Integer isDel;

	/**
	 *
	 */
	@ApiModelProperty(value = "备注", notes = "")
	private String remarks;

	/**
	 *	告警指标名称 (自定义告警页面查询参数, 支持模糊查询)
	 */
	@TableField(exist = false)
	@ApiModelProperty(value = "告警指标名称", notes = "告警指标名称")
	private String alarmIndicatorName;

	/**
	 *	告警模板名称 (自定义告警页面查询参数, 支持模糊查询)
	 */
	@TableField(exist = false)
	@ApiModelProperty(value = "告警模板名称", notes = "告警模板名称")
	private String alarmTemplateName;

	/**
	 *	告警维度
	 */
	@TableField(exist = false)
	@ApiModelProperty(value = "告警维度", notes = "告警维度")
	private String objName;

	/**
	 * 同一个指标下不同告警配置下的比较次序
	 */
	@TableField(exist = false)
	private int sequence = 0;

	/**
	 * 告警维度集合
	 * Map<维度类型, 维度List集合>
	 */
	@TableField(exist = false)
	private Map<String, List<ConfAlarmDimension>> alarmsDimensionMap;

	/**
	 * 告警信息模板
	 */
	@TableField(exist = false)
	private ConfAlarmTemplate alarmTemplate;

	/**
	 * 告警阀值集合
	 */
	@TableField(exist = false)
	private List<ConfAlarmThreshold> thresholds;

	/**
	 * 告警维度
	 */
	@TableField(exist = false)
	private List<ConfAlarmDimension> dimensions;

}